﻿var count = 0;

starId = document.getElementById('star' + i);
starId.src = "/Content/images/stars/checked.png";

function Rate(type, starNumber) {
    if (type == 'over') {
        for (i = 1; i <= starNumber; i++) {
            starId = document.getElementById('star' + i);
            starId.src = "/Content/images/stars/checked.png";
        }
        for (i = starNumber + 1; i <= 5; i++) {
            starId = document.getElementById('star' + i);
            starId.src = "/Content/images/stars/empty.png";
        }
    }
    else if (type == 'out') {
        for (i = 1; i <= count; i++) {
            starId = document.getElementById('star' + i);
            starId.src = "/Content/images/stars/checked.png";
        }
        for (i = count + 1; i <= 5; i++) {
            starId = document.getElementById('star' + i);
            starId.src = "/Content/images/stars/empty.png";
        }
    } else if (type == 'click') {
        count = starNumber;
        starId = document.getElementsByName('Note');
        starId[0].value = count;
    }
}